<template>
  <el-container class="container">
    <el-header>
      <div class="nav_left">
        <img src="../../assets/home-logo.png" alt="" />
        <span>后台管理系统</span>
      </div>
      <el-button @click="logout">退出</el-button>
    </el-header>
    <!-- 头部 -->
    <el-container class="content">
      <home-aside></home-aside>
      <!-- <router-view></router-view> -->
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import HomeAside from './home-aside/home-aside.vue'
export default {
  components: {
    HomeAside,
  },
  methods: {
    logout() {
      this.$store.dispatch('logout').then(() => {
        this.$message({
          type: 'success',
          message: '退出登录成功',
        })
        this.$router.replace('/login')
      })
    },
  },
}
</script>

<style lang="less" scoped>
@import './home.less';
</style>
